package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCommonIndustryDTO;
import com.nineclock.system.pojo.SysCommonIndustry;
import com.nineclock.system.service.SysCommonIndustryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("industry")
@Api(value = "企业创建接口", tags = "系统服务")
public class SysCompanyIndustryController {

    @Autowired
    private SysCommonIndustryService commonIndustryService;
    /**
     * 创建企业或团队
     */
    @ApiOperation("显示全部行业")
    @GetMapping("list")
    public Result<List<SysCommonIndustryDTO>> insertCompany(@RequestParam(required = false) String parentId){

        List<SysCommonIndustryDTO> commonIndustryDTOList = commonIndustryService.getParent(parentId);
        return Result.success(commonIndustryDTOList);
    }

}
